Ziad Eid's profile

Meteor Shower VFX

I took this project as a challenge on how much I can do with a single prefab. The entirety of this effect is done in a single VFX graph, even the impact is on the same prefab!

It consists of one VFX graph and two C# scripts (Move script, and spawn script)
The graph ended up looking like this:
Immediately you'll notice the unusual variable "Alive"
The way my system works, is that as soon as the bolide collides with the ground it changes the "Alive" value to 0
The "Alive" value is directly multiplied with the remaining lifetime of the projectile, and the spawn rate of the trail, so as soon as "Alive" is set to 0, the main projectile instantly dies, and the trail stops spawning so it slowly fizzles out.
When the main projectile dies, it triggers 5 events, which are just the impact effects (pop, shrapnel, smoke... etc)

It would've been much easier to put these effects in their own VFX graph, especially since I already prepared the move script to accept an impact prefab. But it was a self-imposed challenge for the sake of learning something new.
Here's the move script:
The "TrailLifetime" mentioned in the last line of code is just basically a value that accounts for the entire lifetime of any remaining game objects
Here's the spawn script:
And finally, here are a few downfalls and their potential fixes:

#1: The "Alive" value is a float not a boolean
FIX: this one is kind of silly, but I had absolutely no way of using a boolean in VFX graph, it treats "true or false" as a different thing from 0 and 1... so I can't use the "false" as a value of 0 in mathematics etc. I'm still trying to figure out any way to incorperate bools into VFX graph.

#2: Because the effect is condensed into one prefab, the hitbox of the original meteor stays on the ground, so it's possible for other objects to collide into the invisible hitbox.
FIX: Delete the collider as soon as an impact event happens. Should be pretty easy.

#3: The rubble/shrapnel from the meteor only ever collides with the ground plane
FIX: This is because I set the collider for the rubble specifically to be in world space not local space. It should be fairly easy to fix but I was too burned out to fix it locally since it wasn't going to show up in this scene anyways.

#4: The impact effect is pretty weak. Could use a shockwave or even a ground aftermath
FIX: This one is much harder than the other two because it seems like there's a hard limit on how many events that can happen on a single particle's death on a single VFX graph, I tried to add more details but the VFX graph would immediately delete the parent. The only way around this is to add the new effects to a new separate impact prefab, which would've been pretty easy to do.. but the entire point of the project was me challenging myself not to do that.

#5: The meteors all spawn with the exact same size
FIX: This, along more other tweaks and nitpicks would've been fairly easy to do, but I was already ready to move on from this project as I've set my sights on a brand new one and I couldn't wait to try it .

Assets used:
https://assetstore.unity.com/packages/3d/props/exterior/rock-package-118182
https://blog.unity.com/technology/free-vfx-image-sequences-flipbooks
Meteor Shower VFX
Published:

Owner

Meteor Shower VFX

Published: